package com.vlin.api.client.request.defaut;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

import com.vlin.api.client.Params;
import com.vlin.api.client.request.ParamsProducer;
import com.vlin.api.client.request.tuya.TuyaParamsProducer;
import com.vlin.constant.API;
import com.vlin.token.Token;

public class DefaultParamsProducer implements ParamsProducer {

	private Map<API, ParamsProducer> map = new ConcurrentHashMap<>();
	
	public DefaultParamsProducer() {
		map.put(API.TUYA, new TuyaParamsProducer());
	}

	@Override
	public boolean support(API api) {
		
		return map.containsKey(api);
	}

	@Override
	public Params produce(API api) {
		return map.get(api).produce(api);
	}

	@Override
	public Params produce(API api, Token token) {
		
		return map.get(api).produce(api, token);
	}

	@Override
	public Params produce(API api, String token) {
		
		return map.get(api).produce(api, token);
	}

	
}
